package printer;

import java.util.Set;
import java.util.TreeSet;

import comparableForCustomer.BirthdayComparable;
import polo.Customer;

public class Printer {
	public static void printById(Set<Customer> set){
		System.out.println("id\tname\tmail\t\t\tsex\t\tbirthday\t");
		for(Customer i: set){
			i.toString();
		}
	}
	public static void PrintByBirthday(Set<Customer> set){
		System.out.println("id\tname\tmail\t\t\tsex\t\tbirthday\t");
		Set<Customer> set1 = new TreeSet(new BirthdayComparable());
		for(Customer i: set){
			set1.add(i);
		}
		
		for(Customer t: set1){
			t.toString();
		}
	}
	
	public static void printXML(Set<Customer> set){
		String str = "<Customers>\n";
		for(Customer i:set){
			str += "\t<Customer id=\"" + i.getId() + "\">\n";
			str += "\t\t<name>" + i.getName() + "<name>\n";
			str += "\t\t<birth>" + i.getBirthday() + "</birth>\n";
			str += "\t\t<mail>" + i.getMail() + "</mail>\n";
			str += "\t\t<sex>" + i.getSex() + "</sex>\n";
		}
		str += "\t</Customer>\n";
		str += "</Customers>\n";
		
		System.out.println(str);
	}
}
